package com.datastructure.test.media;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Media {

     static ArrayList<Integer> data = new ArrayList<>();
    public static void main(String[] args) {
        //5,2,3,4,1,6,7,0,8
        double sum = 0;
        String data = "";
        Scanner scanner = new Scanner(System.in);
        if(scanner.hasNext()){
            int i = scanner.nextInt();
        }
        scanner.nextLine();
        if(scanner.hasNext()){
            data = scanner.nextLine();
        }
        String[] split = data.split(" ");
        int [] dataSet = new int[split.length];
        for (int j = 0; j < split.length; j++) {
            dataSet[j]=Integer.parseInt(split[j]);
        }

        System.out.println(sum);
    }

    public static void Insert(Integer num) {
        data.add(num);
    }

    public static Double GetMedian() {
        double result;
        int length = data.size();
        if(length==0){
            return 0.00;
        }
        if(length==1){
            return (double)data.get(0);
        } else {
            Collections.sort(data);
            int media = length / 2;
            if (length % 2 == 0) {
                result= (double) ((double)(data.get(media) + data.get(media - 1)) / (double)2);
                System.out.println(result);
            } else {
                result= (double) data.get(media);
            }
        }
        return result;
    }
}
